package Interface;

import java.util.Objects;

public class Boy extends Person implements Play{
    Boy()
    {}

    Boy(String name, int age)
    {
        super(name, age);
    }

    @Override
    public void play()
    {
        System.out.println("play basketball");
    }

    @Override
    void Study()
    {
        System.out.println("学习数学");
    }

    public boolean equals(Object obj)
    {
        return (this.getAge() == ((Boy)obj).getAge());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(this.getAge());
    }
}
